﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using MinGuiLuo;

namespace WinFromDevelopFramework
{
    /// <summary>
    /// 初始化框架
    /// </summary>
    public class ClientApp : AppImplementationBase
    {
        #region 构造函数 & 注册
        private ClientApp( ) { }
        /// <summary>
        /// 注册客户端应用程序。
        /// 在 WPF Application 类的构造函数中调用此法。
        /// </summary>
        /// <param name="wpfClientApp"></param>
        public static void Register( )
        {
            new ClientApp().AttachTo();
        }
        public static void Register(Form mainfrm)
        {
            App.Current.MainWindow = mainfrm;
            new ClientApp().AttachTo();
        }
        private void AttachTo( )
        {
            this.OnAppStartup();
        }
        #endregion
        protected override void InitEnvironment( )
        {
            Thread.CurrentThread.CurrentUICulture = new CultureInfo("zh-CHS");
            base.InitEnvironment();
        }

    }
}
